<style>
#wg-menu{}


#wg-menu .cate{background-color:#A3B2D3;border-radius: 5px;}
#wg-menu .cate dt{color:#3E336F;margin-top:3px;line-height:43px;letter-spacing: 10px;background:url(/weixin/img/menu-off.png) no-repeat 210px;cursor: pointer;border-radius: 5px;padding:0 40px;font-size: 20px;font-weight: bold;}
#wg-menu .cate dt.menuon{background:url(/weixin/img/menu-on.png) no-repeat 210px;}
#wg-menu .cate dd{display:none;margin-right:50px;}
#wg-menu .cate dd a{line-height:37px;display:block;text-align:right;color:#fff;letter-spacing: 10px;font-size:18px;}
#wg-menu .cate dd .current{margin-left:8px;width:194px;padding-right:60px;background:url(/skin/img/cate-current.png);}

</style>
<script>
function closeAll(){
	$(".fcate dd").hide();
	$(".fcate dt").removeClass('menuon');
}
function showCurrent(){
	$("#wg-menu .current").parent().show('slow');
	$("#wg-menu .current").parent().parent().find('dt').addClass('menuon');
}
function showClick(obj){
	$(obj).siblings("dd").show('slow');
	$(obj).addClass('menuon');
}
$(document).ready(function(){
	showCurrent();
	$(".fcate dt").click(function(){
		closeAll();
		//showCurrent();
		showClick(this);
	});
});

</script>

<div id="wg-menu">

	<div class="cate">
		<?php
		foreach($data['index'] as $key=>$val){
			foreach($val as $key1=>$val1){
				$cinfo = $data['cateTree'][$key1];
			?>
				<dl class="fcate a-split">
					<dt>
						<?=$key1?>
						</dt>
					<dd>
						<?php
						foreach($cinfo as $key1=>$val1){
							?>
							<a href="?cid=<?=$val1['id']?>" class="<?=$val1['id']==$data['current']?'current':''?>"><?=$val1['second_category']?></a>
							<?php
						}
						?>
					</dd>
				</dl>
			<?php
		}
		}
		?>
	</div>
</div>
